﻿using Common;
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace WebApp.Common
{
    public class BaseController: Controller
    {
        /// <summary>
        /// 操作结果
        /// </summary>
      protected  OperatingResult or = new OperatingResult();

        /// <summary>
        /// 日志对象
        /// </summary>
        protected ILog log = null;

        /// <summary>
        /// Action运行时验证身份
        /// </summary>
        /// <param name="filterContext">过滤内容</param>
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            string a = this.GetType().Name;
            log = LogManager.GetLogger(this.GetType().Name);
            //this.LoginUser = Session["user"] as User;
            ////赋值SystemID
            //if (Session["systemid"] != null)
            //{
            //    int system = -1; //没有-1
            //    int.TryParse(Session["systemid"].ToString(), out system);
            //    this.SystemID = system;

            //    // ValidateSystemAuthorization(filterContext);//验证权限
            //}
            //if (this.LoginUser != null)
            //{
            //    ViewBag.RealName = this.LoginUser.RealName;
            //    ViewBag.LoginName = this.LoginUser.LoginName;
            //    ViewBag.RoleID = this.LoginUser.RoleID;
            //    ViewBag.PassWord = this.LoginUser.PassWord;
            //    if (this.LoginUser.RoleID == WebApp.Global.Roles.StudentID)
            //    {
            //        ViewBag.IsServer = "false";
            //    }
            //    else { ViewBag.IsServer = "true"; }
            //}
            base.OnActionExecuting(filterContext);
        }
    }
}